import {
    View,
    Text,
    StyleSheet,
    Animated,
    Easing,
    TouchableOpacity,
    TouchableOpacityProps,
    ViewProps, InteractionManager
} from 'react-native'
import React, {Component} from 'react'
import LottieView from 'lottie-react-native';
import {HUNDRED_PERCENT} from "../../style";
import toast from "../common/ToastProxy";
import {AppIcon} from "../../assets/icon/AppIcon";


interface LoveCollectProps extends ViewProps {
    onCheck: (isChecked: boolean) => void,
    checked?: boolean,
    label: string
}

interface LoveCollectState {
}


export default class LoveCollect extends Component<LoveCollectProps, LoveCollectState> {

    constructor(props: LoveCollectProps) {
        super(props);
    }


    onChecked = () => {
        this.props.onCheck(!this.props.checked);
    };

    componentWillUnmount() {
    }

    render() {
        return (
            <TouchableOpacity style={[this.props.style]} activeOpacity={1}
                              onPress={this.onChecked}>
                <AppIcon
                    size={18}
                    name={"love-b"}
                    color={this.props.checked ? "red" : "#B0B0B0"}
                />
                <Text style={{fontSize: 11, color: "#9B9B9B", marginTop: 3}}>
                    {this.props.label}
                </Text>
            </TouchableOpacity>)
    }
}

const LoveCollectStyle = StyleSheet.create({
    container: {}
});

 